<template>

  <div class="modal"
       v-if="visible"
       @click="onClick">
  </div>

</template>

<script>
export default {
  name: "com-modal",
  props: {
    // 显示状态
    visible: {
      type: Boolean,
      default: false
    },
    // 是否点击隐藏
    isClickHiden: {
      type: Boolean,
      default: true
    }
  },
  computed: {},
  methods: {
    onClick: function () {
      if (this.isClickHiden) {
        this.visible =false;
        this.$emit("modalHiden");
      }
    }
  }
}
</script>

<style scoped lang="less">
@import "./com-modal.less";
</style>